import axios from '@/libs/axios1';
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' };
let baseUrl = '/scientific/projectManage';
// 获取科研内容(申请)
export const queryProject = (params) => {
    return axios({
        url: `${baseUrl}/page`,
        method: 'GET',
        params,
        headers: jsonHeaders,
    });
};

export const queryAllProject = () => {
    return axios({
        url: `${baseUrl}`,
        method: 'GET',
        headers: jsonHeaders,
    });
};

//创建科研信息(申请)
export const addProject = (data) => {
    return axios({
        url: `${baseUrl}`,
        method: 'POST',
        data,
        headers: jsonHeaders,
    });
};

//修改科研信息(申请)
export const updateProject = (id, data) => {
    return axios({
        url: `${baseUrl}/${id}`,
        method: 'PUT',
        data,
        headers: jsonHeaders,
    });
};

//查询科研详情
export const getProjectDetail = (id) => {
    return axios({
        url: `${baseUrl}/${id}`,
        method: 'GET',
        headers: jsonHeaders,
    });
};

//删除科研信息(申请)
export const delProject = (id) => {
    return axios({
        url: `${baseUrl}/${id}`,
        method: 'DELETE',
        headers: jsonHeaders,
    });
};

export const batchDelProject = (ids) => {
    return axios({
        url: `${baseUrl}/de`,
        method: 'DELETE',
        data:ids,
        headers: jsonHeaders,
    });
};